#ifndef __CONNECT_H
#define __CONNECT_H

#include "main.h"

#define RX_BUFFER_SIZE 128

extern uint8_t rx_buffer[RX_BUFFER_SIZE];
extern uint8_t rx_data;
extern uint8_t rx_index;
extern uint8_t rx_complete_flag;

extern int white_piece_flag;
extern int black_piece_flag;

extern UART_HandleTypeDef huart1;


void UART_Parser_Init(UART_HandleTypeDef *huart);

void UART_ParseBuffer(void);

void UART_Parser_RxCallback(UART_HandleTypeDef *huart);

void UART_SendString_IT(UART_HandleTypeDef *huart, const char *str);
	
void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart);

#endif
